const hospitalServ = require('../service/hospitalServ.js')

const hospitalCtrl = {
  hspInfo: async (ctx) => {
    const res = await hospitalServ.hspInfoServ()
    ctx.body = {
      code: 0,
      msg: 'success',
      data:res[0]
    }
  },
  appoimentHsp :async (ctx) =>{
    let data = ctx.request.body
     await hospitalServ.appoimentHspServ(data)
    ctx.body = {
      code: 0,
      msg: 'success',
      // data:res
    }
  },
  appoimentStatus:async (ctx) =>{
    let data = ctx.request.body
     const res = await hospitalServ.appoimentStatusServ(data)
    ctx.body = {
      code: 0,
      msg: 'success',
      data:res
    }
  },
  cancleAppoi:async (ctx) =>{
    let data = ctx.request.body
    await hospitalServ.cancleAppoiServ(data)
    ctx.body = {
      code: 0,
      msg: 'success',
    }
  },
  editeHosiptal:async (ctx) =>{
    let data = ctx.request.body
    await hospitalServ.editeHosiptalWebServ(data)
    ctx.body = {
      code: 0,
      msg: 'success',
    }
  },
}

module.exports  = hospitalCtrl